xend: Revert changeset 15002. Breaks xend restart in some cases.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 3 May 2007 10:22:58 +0000 (11:22 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 3 May 2007 10:22:58 +0000 (11:22 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/python/xen/xend/server/SrvDaemon.py
tools/python/xen/xend/server/SrvServer.py

index ccb485d1fbd9adc49e50dee6f637c058da01e3e8..a265aef9067e550c9a7cacfcf4143eb81bfbff6c 100644 (file)
@@ -342,7 +342,7 @@ class Daemon:
                 log.info("Xend version: Unknown.")
 
             relocate.listenRelocation()
-            servers = SrvServer.create(status)
+            servers = SrvServer.create()
             servers.start(status)
             del servers
             
index 544be9725d8a629ade4f0ae43323de8b328759ab..10a09a4c56bdb59710d367385a208b48436a7175 100644 (file)
@@ -95,6 +95,14 @@ class XendServers:
         self.cleanup(signum, frame, reloading = True)
 
     def start(self, status):
+        # Running the network script will spawn another process, which takes
+        # the status fd with it unless we set FD_CLOEXEC.  Failing to do this
+        # causes the read in SrvDaemon to hang even when we have written here.
+        if status:
+            fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
+        
+        Vifctl.network('start')
+
         # Prepare to catch SIGTERM (received when 'xend stop' is executed)
         # and call each server's cleanup if possible
         signal.signal(signal.SIGTERM, self.cleanup)
@@ -241,15 +249,7 @@ def _loadConfig(servers, root, reload):
         servers.add(XMLRPCServer(XendAPI.AUTH_PAM, False))
 
 
-def create(status):
-    # Running the network script will spawn another process, which takes
-    # the status fd with it unless we set FD_CLOEXEC.  Failing to do this
-    # causes the read in SrvDaemon to hang even when we have written here.
-    if status:
-        fcntl.fcntl(status, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
-    
-    Vifctl.network('start')
-
+def create():
     root = SrvDir()
     root.putChild('xend', SrvRoot())
     servers = XendServers(root)